﻿using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace ARchGL.Platform.Core
{
    /// <summary>
    /// 安全检查 数据实体
    /// </summary>
    [Table("JN_" + nameof(SecurityChecks))]
    public class SecurityChecks : EntityCheckDateBase
    {
        /// <summary>
        /// 项目标识
        /// </summary>
        public Guid ProjectId { get; set; }
        /// <summary>
        /// 编号
        /// </summary>
        public long Number { get; set; }
        /// <summary>
        /// 检查内容
        /// </summary>
        public string Content { get; set; }
        /// <summary>
        /// 检查结果
        /// </summary>
        public string Result { get; set; }
        /// <summary>
        /// 检查类型，获取检查性质的根数据
        /// </summary>
        public Guid CheckItemId { get; set; }
        /// <summary>
        /// 状态：1整改中/书面整改、2已整改/待复查、3已完成/通过、4已撤销
        /// </summary>
        public EnumCheckAndFeedbackStatus Status { get; set; }
        /// <summary>
        /// 初始状态（不能被编辑）用于判断是整改通知单还是检查通知单
        /// </summary>
        public EnumCheckAndFeedbackStatus OriginStatus { get; set; }
        /// <summary>
        /// 执行检查人标识集合
        /// </summary>
        public string CheckUsersArray { get; set; }
        /// <summary>
        /// 抄送人标识集合
        /// </summary>
        public string CCUsersArray { get; set; }
        /// <summary>
        /// 执行检查性质标识集合
        /// </summary>
        public string SecurityChecksPropertysArray { get; set; }
        /// <summary>
        /// 视图标识集合
        /// </summary>
        public string ProjectViewPortsArray { get; set; }
        /// <summary>
        /// 被通知人/整改人
        /// </summary>
        public string NotifyUsersArray { get; set; }
        /// <summary>
        /// 整改要求（语言描述整改内容）
        /// </summary>
        public string CorrectContent { get; set; }
        /// <summary>
        /// 整改完成日期（截止日期）
        /// </summary>
        public DateTime? CorrectDate { get; set; }
        //附件在 Attachments 表中通过 Id 关联
    }

    /// <summary>
    /// 安全检查 移交记录
    /// </summary>
    [Table("JN_" + nameof(SecurityChecksTurnOverHistorys))]
    public class SecurityChecksTurnOverHistorys : EntityCreatorUserIdBase
    {
        /// <summary>
        /// 检查标识
        /// </summary>
        public Guid CheckId { get; set; }
        /// <summary>
        /// 接收人标识集合
        /// </summary>
        public string UserArray { get; set; }
    }

    /// <summary>
    /// 安全检查 整改/回复/复查/
    /// </summary>
    [Table("JN_" + nameof(SecurityCheckAndFeedbacks))]
    public class SecurityCheckAndFeedbacks : EntityCreatorUserIdBase
    {
        /// <summary>
        /// 检查标识
        /// </summary>
        public Guid CheckId { get; set; }
        /// <summary>
        /// 被通知人
        /// </summary>
        public string NotifyUsersArray { get; set; }
        /// <summary>
        /// 抄送人标识集合
        /// </summary>
        public string CCUsersArray { get; set; }
        /// <summary>
        /// 状态：1整改回复、2复查意见
        /// </summary>
        public EnumCheckFeedbackType Type { get; set; }
        /// <summary>
        /// 状态：1整改中/书面整改、2已整改/待复查、3已完成/通过、4已撤销
        /// </summary>
        public EnumCheckAndFeedbackStatus Status { get; set; }
        /// <summary>
        /// 意见/回复
        /// </summary>
        public string Content { get; set; }
        //附件在 Attachments 表中通过 Id 关联
    }

    /// <summary>
    /// 检查项/检查性质 数据实体
    /// </summary>
    [Table("JN_" + nameof(SecurityCheckItems))]
    public class SecurityCheckItems : EntitySoftDeleteBase
    {
        /// <summary>
        /// 项目标识
        /// </summary>
        public Guid ProjectId { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 父级标识
        /// </summary>
        public Guid? ParentId { get; set; }
        /// <summary>
        /// 类型：1检查项、2检查性质
        /// </summary>
        public EnumCheckItemType Type { get; set; }
    }
}
